<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qclworksize.cpp -->
  <title>QCLWorkSize Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <script src="./scripts/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />  <script src="./scripts/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="150"><img src="images/qt-logo.png" align="left" border="0" />&nbsp;&nbsp;<img src="images/qtopencl-logo.png" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"> <a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="qtopencl-all-classes.html"><font color="#004faf">All Classes</font></a></td>
</table>              <li><a href="modules.html">Modules</a></li>              <li>QtCL</li>
              <li>QCLWorkSize</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QCLWorkSize Class Reference</h1>
<!-- $$$QCLWorkSize-brief -->
<p>The QCLWorkSize class defines the size of an item of work for an OpenCL kernel. <a href="#details">More...</a></p>
<!-- @@@QCLWorkSize -->
<pre class="highlightedCode brush: cpp">    #include &lt;QCLWorkSize&gt;</pre><p>This class was introduced in QtOpenCL 4.7.</p>
<ul>
<li><a href="qclworksize-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#QCLWorkSize">QCLWorkSize</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#QCLWorkSize-2">QCLWorkSize</a></b> ( size_t <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#QCLWorkSize-3">QCLWorkSize</a></b> ( size_t <i>width</i>, size_t <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#QCLWorkSize-4">QCLWorkSize</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#QCLWorkSize-5">QCLWorkSize</a></b> ( size_t <i>width</i>, size_t <i>height</i>, size_t <i>depth</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> size_t </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#depth">depth</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> size_t </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#dimensions">dimensions</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> size_t </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#height">height</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLWorkSize </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#roundTo">roundTo</a></b> ( const QCLWorkSize &amp; <i>size</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const size_t * </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#sizes">sizes</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLWorkSize </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#toLocalWorkSize">toLocalWorkSize</a></b> ( const QCLWorkSize &amp; <i>maxWorkItemSize</i>, size_t <i>maxItemsPerGroup</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLWorkSize </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#toLocalWorkSize-2">toLocalWorkSize</a></b> ( const QCLDevice &amp; <i>device</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#toString">toString</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> size_t </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#width">width</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#operator-not-eq">operator!=</a></b> ( const QCLWorkSize &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#operator-eq-eq">operator==</a></b> ( const QCLWorkSize &amp; <i>other</i> ) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QCLWorkSize </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#fromString">fromString</a></b> ( const QString &amp; <i>str</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#operator-lt-lt">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>stream</i>, const QCLWorkSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qclworksize.html#operator-gt-gt">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>stream</i>, QCLWorkSize &amp; <i>size</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QCLWorkSize-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QCLWorkSize class defines the size of an item of work for an OpenCL kernel.</p>
<p>OpenCL work sizes may be single-dimensional, two-dimensional, or three-dimensional:</p>
<pre class="highlightedCode brush: cpp">    QCLWorkSize oned(128);
    QCLWorkSize twod(16, 16);
    QCLWorkSize threed(32, 32, 16);
    ...
    QCLKernel kernel = ...;
    kernel.setGlobalWorkSize(oned);
    kernel.setGlobalWorkSize(twod);
    kernel.setGlobalWorkSize(threed);</pre>
<p>For convenience, <a href="qclkernel.html#setGlobalWorkSize">QCLKernel::setGlobalWorkSize</a>() and <a href="qclkernel.html#setLocalWorkSize">QCLKernel::setLocalWorkSize</a>() can be specified by a QCLWorkSize object or direct numeric arguments:</p>
<pre class="highlightedCode brush: cpp">    QCLKernel kernel = ...;
    kernel.setGlobalWorkSize(128);
    kernel.setGlobalWorkSize(16, 16);
    kernel.setGlobalWorkSize(32, 32, 16);</pre>
</div>
<p>See also <a href="qclkernel.html">QCLKernel</a>.</p>
<!-- @@@QCLWorkSize -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCLWorkSize[overload1]$$$QCLWorkSize -->
<h3 class="fn"><a name="QCLWorkSize"></a>QCLWorkSize::QCLWorkSize ()</h3>
<p>Constructs a default work size consisting of a single dimension with <a href="qclworksize.html#width">width</a>() set to 1.</p>
<!-- @@@QCLWorkSize -->
<!-- $$$QCLWorkSize$$$QCLWorkSizesize_t -->
<h3 class="fn"><a name="QCLWorkSize-2"></a>QCLWorkSize::QCLWorkSize ( size_t <i>size</i> )</h3>
<p>Constructs a single-dimensional work size with <a href="qclworksize.html#width">width</a>() set to <i>size</i>. The <a href="qclworksize.html#height">height</a>() and <a href="qclworksize.html#depth">depth</a>() will be set to 1.</p>
<!-- @@@QCLWorkSize -->
<!-- $$$QCLWorkSize$$$QCLWorkSizesize_tsize_t -->
<h3 class="fn"><a name="QCLWorkSize-3"></a>QCLWorkSize::QCLWorkSize ( size_t <i>width</i>, size_t <i>height</i> )</h3>
<p>Constructs a two-dimensional work size of <i>width</i> x <i>height</i>. The <a href="qclworksize.html#depth">depth</a>() will be set to 1.</p>
<!-- @@@QCLWorkSize -->
<!-- $$$QCLWorkSize$$$QCLWorkSizeconstQSize& -->
<h3 class="fn"><a name="QCLWorkSize-4"></a>QCLWorkSize::QCLWorkSize ( const QSize &amp; <i>size</i> )</h3>
<p>Constructs a two-dimensional work size set to <i>size</i>. The <a href="qclworksize.html#depth">depth</a>() will be set to 1.</p>
<!-- @@@QCLWorkSize -->
<!-- $$$QCLWorkSize$$$QCLWorkSizesize_tsize_tsize_t -->
<h3 class="fn"><a name="QCLWorkSize-5"></a>QCLWorkSize::QCLWorkSize ( size_t <i>width</i>, size_t <i>height</i>, size_t <i>depth</i> )</h3>
<p>Constructs a three-dimensional work size of <i>width</i> x <i>height</i> x <i>depth</i>.</p>
<!-- @@@QCLWorkSize -->
<!-- $$$depth[overload1]$$$depth -->
<h3 class="fn"><a name="depth"></a>size_t QCLWorkSize::depth () const</h3>
<p>Returns the depth of this work size specification.</p>
<!-- @@@depth -->
<!-- $$$dimensions[overload1]$$$dimensions -->
<h3 class="fn"><a name="dimensions"></a>size_t QCLWorkSize::dimensions () const</h3>
<p>Returns the number of dimensions for this work size, 1, 2, or 3.</p>
<!-- @@@dimensions -->
<!-- $$$fromString[overload1]$$$fromStringconstQString& -->
<h3 class="fn"><a name="fromString"></a>QCLWorkSize QCLWorkSize::fromString ( const QString &amp; <i>str</i> )<tt> [static]</tt></h3>
<p>Returns the work size that corresponds to the contents of <i>str</i>. Components are assumed to be separated by 'x'.</p>
<p>See also <a href="qclworksize.html#toString">toString</a>().</p>
<!-- @@@fromString -->
<!-- $$$height[overload1]$$$height -->
<h3 class="fn"><a name="height"></a>size_t QCLWorkSize::height () const</h3>
<p>Returns the height of this work size specification.</p>
<!-- @@@height -->
<!-- $$$roundTo[overload1]$$$roundToconstQCLWorkSize& -->
<h3 class="fn"><a name="roundTo"></a>QCLWorkSize QCLWorkSize::roundTo ( const QCLWorkSize &amp; <i>size</i> ) const</h3>
<p>Returns the result of rounding this work size up to a multiple of <i>size</i>.</p>
<!-- @@@roundTo -->
<!-- $$$sizes[overload1]$$$sizes -->
<h3 class="fn"><a name="sizes"></a>const size_t * QCLWorkSize::sizes () const</h3>
<p>Returns a const pointer to the size array within this object.</p>
<!-- @@@sizes -->
<!-- $$$toLocalWorkSize[overload1]$$$toLocalWorkSizeconstQCLWorkSize&size_t -->
<h3 class="fn"><a name="toLocalWorkSize"></a>QCLWorkSize QCLWorkSize::toLocalWorkSize ( const QCLWorkSize &amp; <i>maxWorkItemSize</i>, size_t <i>maxItemsPerGroup</i> ) const</h3>
<p>Returns the best-fit local work size that evenly divides this work size and fits within the maximums defined by <i>maxWorkItemSize</i> and <i>maxItemsPerGroup</i>.</p>
<p>This function is typically used to convert an arbitrary global work size on a <a href="qclkernel.html">QCLKernel</a> into a compatible local work size.</p>
<p>See also <a href="qclkernel.html#setLocalWorkSize">QCLKernel::setLocalWorkSize</a>().</p>
<!-- @@@toLocalWorkSize -->
<!-- $$$toLocalWorkSize$$$toLocalWorkSizeconstQCLDevice& -->
<h3 class="fn"><a name="toLocalWorkSize-2"></a>QCLWorkSize QCLWorkSize::toLocalWorkSize ( const <a href="qcldevice.html">QCLDevice</a> &amp; <i>device</i> ) const</h3>
<p>Returns the best-fit local work size that evenly divides this work size and fits within the maximum work group size of <i>device</i>.</p>
<p>This function is typically used to convert an arbitrary global work size on a <a href="qclkernel.html">QCLKernel</a> into a compatible local work size.</p>
<p>See also <a href="qclkernel.html#setLocalWorkSize">QCLKernel::setLocalWorkSize</a>().</p>
<!-- @@@toLocalWorkSize -->
<!-- $$$toString[overload1]$$$toString -->
<h3 class="fn"><a name="toString"></a>QString QCLWorkSize::toString () const</h3>
<p>Returns the string form of this work size, with components separated by 'x'.</p>
<p>See also <a href="qclworksize.html#fromString">fromString</a>().</p>
<!-- @@@toString -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn"><a name="width"></a>size_t QCLWorkSize::width () const</h3>
<p>Returns the width of this work size specification.</p>
<!-- @@@width -->
<!-- $$$operator!=[overload1]$$$operator!=constQCLWorkSize& -->
<h3 class="fn"><a name="operator-not-eq"></a>bool QCLWorkSize::operator!= ( const QCLWorkSize &amp; <i>other</i> ) const</h3>
<p>Returns true if this work size specification does not have the same dimensions as <i>other</i>; false otherwise.</p>
<p>See also <a href="qclworksize.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator==[overload1]$$$operator==constQCLWorkSize& -->
<h3 class="fn"><a name="operator-eq-eq"></a>bool QCLWorkSize::operator== ( const QCLWorkSize &amp; <i>other</i> ) const</h3>
<p>Returns true if this work size specification has the same dimensions as <i>other</i>; false otherwise.</p>
<p>See also <a href="qclworksize.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<[overload1]$$$operator<<QDataStream&constQCLWorkSize& -->
<h3 class="fn"><a name="operator-lt-lt"></a>QDataStream &amp; operator&lt;&lt; ( QDataStream &amp; <i>stream</i>, const QCLWorkSize &amp; <i>size</i> )</h3>
<p>Writes the given <i>size</i> to the given <i>stream</i>, and returns a reference to the stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>[overload1]$$$operator>>QDataStream&QCLWorkSize& -->
<h3 class="fn"><a name="operator-gt-gt"></a>QDataStream &amp; operator&gt;&gt; ( QDataStream &amp; <i>stream</i>, QCLWorkSize &amp; <i>size</i> )</h3>
<p>Reads a size from the given <i>stream</i> into the given <i>size</i>, and returns a reference to the stream.</p>
<!-- @@@operator>> -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 Nokia Corporation</td>
<td align="right">QtOpenCL Documentation</td>
</tr></table></div></address>  <script src="scripts/functions.js" type="text/javascript"></script>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</body>
</html>
